#!/bin/bash

Path=$(pwd)
rosservice call /finish_trajectory 0
rosservice call /write_state "{filename: '${Path}/map.pbstream'}"

rosrun cartographer_ros cartographer_pbstream_to_ros_map -map_filestem=${Path}/map -pbstream_filename=${Path}/map.pbstream -resolution=0.05

scp map* lyx@192.168.8.243:~
